# -*- coding: utf-8 -*-
# @Time : 2025/10/30 15:22:03
# @Desc : 程序配置
# @Author : Sean
# @File   : config.py
from utils.common import get_free_port, get_resource_path, get_root_path
import platform


class Config:
    # 应用程序相关配置
    appName = "PVAX应用程序"  # 应用名称
    appPackage = "pvax_main"  # 应用包名
    appVersion = "0.0.6.5"  # 应用版本
    appDeveloper = "Sean"  # 开发者
    appUpdateUrl = ""  # 更新地址
    appHome = ""  # 主页地址
    description = "PVAX跨平台应用程序"  # 描述
    appISSID = "{{CD0E1422-D887-5513-D77C-2FCBAA7D9734}"  # 打包唯一编号
    copyRigth = "Sean"  # 版权信息
    port = get_free_port()  # 服务器端口
    devPort = 57805  # 开发端口仅在开发模式development=True下有效
    storage_path = get_resource_path("storage")  # 存储路径
    debug = False  # 是否调试模式
    development = False  # 开发模式 默认开启  False 为生产模式
    log = False  # 是否开启后端日志
    # 系统相关配置
    cpuArch = platform.processor()  # 本机CPU架构
    appSystem = platform.system()  # 本机系统类型
    root_path = get_root_path()  # 项目根目录
    # 生成打包配置文件相关配置
    add_folder = [("gui/dist", "gui/dist"), ("icon", "icon")]  # 打包文件静态依赖文件
    isWin7 = False  # 是否支持win7系统
    win7_need = [
        (".venv/Lib/site-packages/cefpython3/icudtl.dat", "./"),
        (
            ".venv/Lib/site-packages/cefpython3/natives_blob.bin",
            "./",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/subprocess.exe",
            "./",
        ),
        (".venv/Lib/site-packages/cefpython3/libcef.dll", "./"),
        (
            ".venv/Lib/site-packages/cefpython3/chrome_elf.dll",
            "./",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/v8_context_snapshot.bin",
            "./",
        ),
        (".venv/Lib/site-packages/cefpython3/cef.pak", "./"),
        (
            ".venv/Lib/site-packages/cefpython3/cef_100_percent.pak",
            "./",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/cef_200_percent.pak",
            "./",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/cef_extensions.pak",
            "./",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/icudtl.dat",
            "./cefpython3",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/natives_blob.bin",
            "./cefpython3",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/locales/en-US.pak",
            "./locales",
        ),
        (
            ".venv/Lib/site-packages/cefpython3/locales/zh-CN.pak",
            "./locales",
        ),
    ]  # win7系统需要添加的dll文件 TODO
    icon = ["icon/logo.ico"]  # 程序图标
